package cn.icanci.ladybird.service.impl;

import cn.icanci.ladybird.pojo.entity.TicketDetailsTicketPriceMiddle;
import cn.icanci.ladybird.dao.TicketDetailsTicketPriceMiddleDao;
import cn.icanci.ladybird.service.TicketDetailsTicketPriceMiddleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TicketDetailsTicketPriceMiddle)表服务实现类
 *
 * @author makejava
 * @since 2020-09-29 20:44:06
 */
@Service("ticketDetailsTicketPriceMiddleService")
public class TicketDetailsTicketPriceMiddleServiceImpl implements TicketDetailsTicketPriceMiddleService {
    @Resource
    private TicketDetailsTicketPriceMiddleDao ticketDetailsTicketPriceMiddleDao;

    /**
     * 通过ID查询单条数据
     *
     * @param ticketDetailsTicketPriceId 主键
     * @return 实例对象
     */
    @Override
    public TicketDetailsTicketPriceMiddle queryById(Long ticketDetailsTicketPriceId) {
        return this.ticketDetailsTicketPriceMiddleDao.queryById(ticketDetailsTicketPriceId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<TicketDetailsTicketPriceMiddle> queryAllByLimit(int offset, int limit) {
        return this.ticketDetailsTicketPriceMiddleDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param ticketDetailsTicketPriceMiddle 实例对象
     * @return 实例对象
     */
    @Override
    public TicketDetailsTicketPriceMiddle insert(TicketDetailsTicketPriceMiddle ticketDetailsTicketPriceMiddle) {
        int insert = this.ticketDetailsTicketPriceMiddleDao.insert(ticketDetailsTicketPriceMiddle);
        return ticketDetailsTicketPriceMiddle;
    }

    /**
     * 修改数据
     *
     * @param ticketDetailsTicketPriceMiddle 实例对象
     * @return 实例对象
     */
    @Override
    public TicketDetailsTicketPriceMiddle update(TicketDetailsTicketPriceMiddle ticketDetailsTicketPriceMiddle) {
        this.ticketDetailsTicketPriceMiddleDao.update(ticketDetailsTicketPriceMiddle);
        return this.ticketDetailsTicketPriceMiddleDao.queryById(ticketDetailsTicketPriceMiddle.getTicketDetailsTicketPriceId());
    }

    /**
     * 通过主键删除数据
     *
     * @param ticketDetailsTicketPriceId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long ticketDetailsTicketPriceId) {
        return this.ticketDetailsTicketPriceMiddleDao.deleteById(ticketDetailsTicketPriceId) > 0;
    }

    @Override
    public List<TicketDetailsTicketPriceMiddle> queryByTicketDetailsId(Long ticketDetailsId) {
        return this.ticketDetailsTicketPriceMiddleDao.queryByTicketDetailsId(ticketDetailsId);
    }

    @Override
    public List<TicketDetailsTicketPriceMiddle> queryManyById(Long ticketDetailsTicketPriceId) {
        return null;
    }
}